﻿@{
    ViewBag.Title = "CompileDeskWork";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@using DepartmentWork.Model
@model DepartmentWork.Model.ProjectDeskWorkViewModel
<link href="~/Assets/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />
<script src="~/Assets/plugins/bootstrap-select/bootstrap-select.min.js"></script>

<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" />
<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker-theme.css" rel="stylesheet" />
<script src="~/Assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="~/Assets/plugins/chosen/chosen.jquery.min.js"></script>
<script src="~/Assets/js/pages/form-elements.js"></script>
<style>
    .btn-default {
        color: #333;
        background-color: #FFF;
        border-color: #CCC;
        height: 34px;
    }
</style>

<div class="page-header">
    <div class="pull-left">
        <ol class="breadcrumb visible-sm visible-md visible-lg">
            <li><a href="index.html"><i class="icon fa fa-home"></i>主页</a></li>
            <li><a href="~/DepartmentArea/DeskWork/DeskWork"><i class="fa fa-envelope"></i>科室管理</a></li>
            <li class="active"><a href="#"><i class="fa fa-envelope"></i>科室工作编辑</a></li>
        </ol>
    </div>
</div>


@{
    if (ViewBag.Flag == "True")
    {
    <div class="alert alert-success">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>&emsp;@ViewBag.FlagInfo！</strong>
    </div>
    }
    if (ViewBag.Flag == "False")
    {
    <div class="alert alert-danger">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>&emsp;操作失败！</strong> @ViewBag.FlagInfo
    </div>
    }
}


<div class="col-md-8 col-xs-12" style="width: 70%">
    <div class="panel bk-widget bk-border-off bk-noradius">
        <div class="panel">
            <div class="panel-heading bk-bg-primary">
                <h6><i class="fa fa-table red"></i><span class="break"></span>工作简况</h6>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td style="width: 15%"><b>工作名称:</b></td>
                                <td style="width: 35%" data-project-field="name">@this.Model.DESKWORK_NAME</td>
                                <td style="width: 15%"><b>工作编号:</b></td>
                                <td style="width: 35%" data-project-field="no">@this.Model.DESKWORK_NO</td>
                            </tr>
                            <tr>
                                <td><b>工作负责人:</b></td>
                                <td data-project-field="owner">@this.Model.DESKWORK_PRINCIPAL</td>
                                <td><b>工作发布人:</b></td>
                                <td data-project-field="user">@this.Model.DESKWORK_FOUNDER</td>
                            </tr>
                            <tr>
                                <td><b>创建日期:</b></td>
                                <td>@this.Model.DESKWORK_CREATETIME.ToString("yyyy-MM-dd")</td>
                                 <td><b>完成期限:</b></td>
                                <td>@this.Model.DESKWORK_DEADINE.ToString("yyyy-MM-dd")</td>
                            </tr>
                            <tr>
                                <td><b>工作内容描述:</b></td>
                                <td colspan="3" data-project-field="description">@this.Model.DESKWORK_DESCRIBE</td>
                            </tr>
                            <tr>
                                <td><b>工作记录:</b></td>
                                <td colspan="5" data-project-field="description">
                                      <textarea readonly="readonly" id="textarea-input" name="tb_Describe" rows="5" class="form-control" placeholder="Content..">
                                          @{
                                              if (ViewBag.JOB!=null)
	{
		                                        foreach (ProjectDeskWorkJoblogging item in ViewBag.JOB)
                                              {
                                                
@:时间： @item.RECORD_TIME      @item.RECORD_NAME@item.RECORD_CONTENT  
                                              }
	}
                                             
                                              
                                              }
                                        

                                      </textarea>

                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="col-lg-4 col-md-12" style="width: 30%; float: right">
    <div class="panel panel-default">
        <div class="panel-heading bk-bg-white">
            <h4><b>科室工作操作</b></h4>
            <div class="panel-actions">
                <a href="#" class="btn-minimize"><i class="fa fa-caret-up"></i></a>
                <a href="#" class="btn-close"><i class="fa fa-times"></i></a>

            </div>
        </div>
        @if (ViewBag.IsAdmin == true)
                    {
                           <div class="panel-body bk-noradius">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                        <span>当前工作状态：<b style="color: firebrick">@this.Model.DESKWORK_STATUS</b></span>
                        <a data-toggle="modal" data-target="#editProjectModal">
                            <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">工作编辑</h4>
                        </a>
                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                        <a data-toggle="modal" data-target="#changeProjectStateModal">
                            <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">修改当前工作状态</h4>
                        </a>
                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
                      @if (Model.DESKWORK_EDITOR == 1)
                      {
                 <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                        <a data-toggle="modal" data-target="#bohui">
                            <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">驳回</h4>
                        </a>
                    </div>
                </div>
            </div>
                      }
            <hr class="bk-margin-off">
        </div>
                    }
           
    </div>
</div>

<!-- 编辑工作（Modal） -->

<div class="modal fade" id="editProjectModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <script>

        window.onload = function () {
            $("#datetimepicker").datepicker({
                autoclose: true,
                pickerPosition: "bottom-right"
            });
        };
    </script>

    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">编辑工作</h4>
            </div>
            <form method="POST" action="@Url.Action("SubmitCompileWork", "DeskWork", new { area = "DepartmentArea" })">
                <div class="modal-body">
                    <input type="hidden" name="hid_DESKWORK_ID" value="@this.Model.DESKWORK_ID"/>
                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">工作名称</label>
                        <div class="col-md-9">
                            <input name="tb_DESKWORK_NAME" value="@this.Model.DESKWORK_NAME" style="border-color: cornflowerblue" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">工作编号：</label>
                        <div class="col-md-9">
                            <input value="@this.Model.DESKWORK_NO" readonly="true" style="border-color: cornflowerblue" name="tb_DESKWORK_NO" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />


                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">工作内容描述：</label>
                        <div class="col-md-9">
                            <textarea name="tb_DESKWORK_DESCRIBE" rows="5" class="form-control" placeholder="Content..">@this.Model.DESKWORK_DESCRIBE</textarea>
                        </div>
                    </div>

                    <br />
                    <div class="row">
                        <label class="col-md-3 control-label">完成期限：</label>
                        <div class="col-md-9">
                            <div class="input-append date" id="datetimepicker" data-date="@DateTime.Now.ToString("yyyy-MM-dd")" data-date-format="yyyy-mm-dd">
                                <input  id="t_BTime"  name="t_BTime" style="border-color: cornflowerblue" class="form-control" size="10" type="text" value="@DateTime.Now.ToString("yyyy-MM-dd")">
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                            <span class="span_DevelopDescription"></span>
                        </div>
                    </div>

                         <br />
                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">工作负责人：</label>
                        <div class="col-md-9">
                      
                            <select name="tb_DESKWORK_PRINCIPAL" id="select_ProjectLeader" class="form-control selectpicker">
                                @{
                                    List<UserInfoViewModel> userList = (List<UserInfoViewModel>)TempData["UserList"];
                                    if (userList != null)
                                    {
                                        for (int i = 0; i < userList.Count(); i++)
                                        {
                                            var item = userList[i];
                                    <option value="@item.UserId">@item.UserName</option>
                                        }
                                    }
                                }
                            </select>

                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">工作发布人：</label>
                        <div class="col-md-9">
                            <input readonly="true" value="@this.Model.DESKWORK_FOUNDER" name="tb_DESKWORK_FOUNDER" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改" />
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>

<!-- 模态框（Modal） -->

<div class="modal fade" id="changeProjectStateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel2">工作状态操作</h4>
            </div>
            <form action="@Url.Action("EditWorkStatus", "DeskWork")" method="POST">
                <div class="modal-body">
                    <input type="hidden" name="tb_DESKWORK_ID" value="@this.Model.DESKWORK_ID"/>
                    <div class="row">
                        <br />
                        <label class="col-md-3 control-label">工作状态操作：</label>
                        <div class="col-md-9">

                            <select name="select_WorkStatus" class="form-control select2">
                                <option value="0">进行中</option>
                                <option value="1">完成</option>
                            </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改" />
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>




 
@*驳回工作*@
<div class="modal fade" id="bohui" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
            </div>
            <form enctype="multipart/form-data" action="@Url.Action("InserBoHui", "DeskWork", new { area = "DepartmentArea" })", method="POST" >

                <div class="modal-body">
                 
                       <div class="row">
                        <label class="col-md-3 control-label" for="text-input">驳回原因：</label>
                        <textarea   name="tb_Describe" rows="5" class="form-control" placeholder="Content.."></textarea>
                    </div>
                       <div class="row">
                        <label class="col-md-3 control-label" for="text-input">确定驳回么？</label>
                           <input type="hidden" id="BOHUI" name="dai_work_idd" value="@this.Model.DESKWORK_ID" />
                    </div>
                    <br />
                    <br />
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" value="确定" class="btn btn-primary" />
                </div>

            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>